<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /* let obj = {
        name: "yj",
        age: 19,
      };

      const set = new WeakSet();
      set.add(obj);
      console.log(set);

      obj = null;
      console.log(set); */

      let obj = {
        name: "yj",
        age: 19,
      };

      const set = new WeakMap();
      set.set(obj, 111);
      console.log(set);

      obj = null;
      console.log(set);
    </script>
  </body>
</html>
